//
//  HFHomeStatuesModel.swift
//  HFWeChat
//
//  Created by 黄来峰 on 16/4/23.
//  Copyright © 2016年 itcast. All rights reserved.
//

import UIKit

class HFHomeStatuesModel: NSObject {
    //微博创建时间
    var created_at: String?
    //微博id
    var id: Int = 0
    //微博信息内容
    var text: String?
    //微博来源
    var source:String?
    //用户模型
    var user: HFUserMessageModel?
    
    init(dict:[String: AnyObject]) {
        super.init()
        setValuesForKeysWithDictionary(dict)
    }
    
    //重写系统的setValue方法
    override func setValue(value: AnyObject?, forKey key: String) {
        if key == "user"{
            if let v = value as? [String: AnyObject]{
                //字典转模型
            user = HFUserMessageModel(dict: v)
            }
        
        }else{
            super.setValue(value, forKey: key)
        }
        
    }
    
    //空实现
    override func setValue(value: AnyObject?, forUndefinedKey key: String) {}
    
    
    
    
}
